
public class Example3 {

	public static void main(String[] args){
		int[] numarry = {1,3,2,45,0,2,0,3,0,25};
		int[] newNums = myTrim0(numarry);
		for(int item:newNums){
			System.out.println(item);
		}
	}
	public static int[] myTrim0(int[] ns) {
		int[] numbers = new int[ns.length];
		int j = 0;
		for(int i=0; i<ns.length; i++) {
			if(ns[i] != 0) {
				numbers[j] = ns[i];
				j++;
			}
		}
		int[] fNumbers = new int[j];
		for(int i=0;i<j;i++) {
			fNumbers[i] = numbers[i];
		}
		return fNumbers;
	}
	
}

